
/**
 * This class will display the laptop model details, switch on details and it
 * receives the user & password and display the login status.
 * 
 * @author Ravi
 * 
 */
public class Laptop {

	String model;
	String make;
	String color;
	int yearOfMake;
	double monitorSize;
	String processorType;
	boolean isOn;

	/*
	 * this method will display the laptop model details
	 */
	void laptopModel() {
		model = "hp";
		System.out.println("Laptop modle is = " + model);
		yearOfMake = 2014;
		System.out.println("Laptop Model year is = " + yearOfMake);
		color = "Silver";
		System.out.println("Laptop Color is = " + color);
		monitorSize = 14.6;
		System.out.println("Laptop monitor size is = " + monitorSize);
	}

	/*
	 * this method will display the laptop switch on status
	 */
	void switchOn() {
		if (!isOn) {
			isOn = true;
			System.out.println("Laptop is switched On");
		} else {
			System.out.println("Laptop is already switched On");
		}
	}

	/*
	 * this method will display the laptop login status based on the received
	 * inputs
	 */
	void logOn(int userName, String pwd) {
		switch (userName) {
		case 1:
			if (pwd == "Ravi") {
				System.out.println("User " + userName + " LogOn Successfull");
			} else {
				System.out.println("LogOn Not Successfull Invalid password");
			}
			break;
		case 2:
			if (pwd == "Kumar") {
				System.out.println("User " + userName + " LogOn Successfull");
			} else {
				System.out.println("LogOn Not Successfull Invalid password");
			}
		case 3:
			if (pwd == "Guest") {
				System.out.println("User " + userName + " LogOn Successfull");
			} else {
				System.out.println("LogOn Not Successfull Invalid password");
			}
			break;
		case 4:
			if (pwd == "Guest") {
				System.out.println("User " + userName + " LogOn Successfull");
			} else {
				System.out.println("LogOn Not Successfull Invalid password");
			}
			break;
		default:
			System.out
					.println("LogOn Not Successfull Invalid user id or password");
			break;
		}
	}

}
